package cn.bdqn.model;

import lombok.Data;

/**
 * @author Awacky
 * @create 2019-07-27 14:08
 */
@Data
public class R  {
    private boolean success;
    private String info;
    private  Object data;

    public R() {
    }

    public R(boolean success, String info, Object data) {
        this.success = success;
        this.info = info;
        this.data = data;
    }
    public static R ok(){
        return  new R(true,null,null);
    }
    public static R error(){
        return  new R(false,null,null);
    }
    public static R ok(String info){
        return  new R(true,info,null);
    }
    public static R error(String info){
        return  new R(false,info,null);
    }
    public static R ok(String info,Object data){
        return  new R(true,info,data);
    }
    public static R error(String info,Object data){
        return  new R(false,info,data);
    }


}
